package ru.susu.algebra.properties;

import java.util.HashMap;

/**
 * @author akargapolov
 * @since: 09.03.2009
 */
public class MapPropertySource implements IPropertySource
{
	private HashMap<String, Object> _properties = new HashMap<String, Object>();

	@Override
	public Object getValue(String key)
	{
		return _properties.get(key);
	}

	@Override
	public Object getValue(String key, Object defaultValue)
	{
		if (_properties.containsKey(key))
		{
			return _properties.get(key);
		}
		return defaultValue;
	}

	@Override
	public void setValue(String key, Object value)
	{
		_properties.put(key, value);
	}

	@Override
	public boolean containsKey(String key)
	{
		return _properties.containsKey(key);
	}

}
